import { requests } from "./requests"

export const reqUserLogin = (data) => {
    return requests({
        url: "/user/userLogin",
        method: 'post',
        data: data
    })
}

export const reqUserRegister = (data) => {
    return requests({
        url: "/user/userRegister",
        method: 'post',
        data: data
    })
}

export const reqMergeChunks = (data) => {
    return requests({
        url: "/file/mergeChunks",
        method: 'post',
        data: data
    })
}

export const reqUploadChunk = (data) => {
    return requests({
        url: "/file/uploadChunk",
        method: 'post',
        data: data
    })
}

export const reqCheckChunk = (data) => {
    return requests({
        url: "/file/checkChunk",
        method: 'post',
        data: data
    })
}

export const reqFolderFile = (data) => {
    return requests({
        url: "/file/getFolderFile",
        method: 'get',
        params: data
    })
}

export const reqSaveFolder = (data) => {
    return requests({
        url: "/file/saveFolder",
        method: 'post',
        data: data
    })
}

export const reqFileblob = (data) => {
    return requests({
        url: "/file/getFile/" + data,
        method: 'get',
        responseType: "blob"
    })
}

export const reqSaveShareFile = (data) => {
    return requests({
        url: "/fileShare/share",
        method: 'post',
        data: data
    })
}

export const reqMyShareFile = (data) => {
    return requests({
        url: "/fileShare/list",
        method: 'get',
        params: data
    })
}

export const reqCancelShare = (data) => {
    return requests({
        url: "/fileShare/update",
        method: 'put',
        data: data
    })
}

export const reqDeleteFile = (data) => {
    return requests({
        url: "/file/getDeleteFile",
        method: 'get',
        params: data
    })
}

export const reqShareFile = (data) => {
    return requests({
        url: "/fileShare/getFile",
        method: 'get',
        params: data
    })
}

export const reqCheck = (data) => {
    return requests({
        url: "/fileShare/check",
        method: 'post',
        data: data
    })
}

export const reqShareInfo = (data) => {
    return requests({
        url: "/fileShare/info/" + data,
        method: 'get',
    })
}

export const reqSaveUserInfo = (data) => {
    return requests({
        url: "/user/info/save",
        method: 'post',
        data: data,
    })
}

export const reqGetUserInfo = (data) => {
    return requests({
        url: "/user/UserInfo",
        method: 'get',
        data: data,
    })
}

export const reqUploadAvatar = (data) => {
    return requests({
        url: "/user/uploadAvatar",
        method: 'post',
        data: data,
    })
}

// 发送添加评论请求
export const reqPostComment = (data) => {
    return requests({
        url: "/comment/save",
        method: 'post',
        data: data,
    })
}
// 根据文件id获取评论列表
export const reqGetCommentList = (data) => {
    return requests({
        url: "/comment/selectByFileId/" + data,
        method: 'get',
    })
}
// 回复内容
export const reqPostReply = (data) => {
    return requests({
        url: '/comment/addReply',
        method: 'post',
        data: data
    })
}

export const reqFolderList = (data) => {
    return requests({
        url: '/file/getFolderList',
        method: 'get',
        params: data
    })
}

export const reqFileTag = (data) => {
    return requests({
        url: '/fileTag/info/' + data,
        method: 'get',
    })
}

export const reqSaveFileTag = (data) => {
    return requests({
        url: '/fileTag/save',
        method: 'post',
        data: data
    })
}

export const reqFile = (data) => {
    return requests({
        url: '/file/info/' + data,
        method: 'get',
    })
}

export const reqSpace = () => {
    return requests({
        url: '/user/getSpace',
        method: 'get',
    })
}

export const reqSaveFileToMe = (data) => {
    return requests({
        url: '/file/saveFileToMe',
        method: 'post',
        data: data
    })
}

export const reqChatList = () => {
    return requests({
        url: '/chat/list',
        method: 'get',
    })
}

export const reqChatDetailList = (data) => {
    return requests({
        url: '/chatDetail/list',
        method: 'get',
        params: data
    })
}

export const reqSearchContacts = (data) => {
    return requests({
        url: '/contacts/search',
        method: 'post',
        data: data
    })
}

export const reqGroupList = () => {
    return requests({
        url: '/group/list',
        method: 'get',
    })
}

export const reqSubmitApply = (data) => {
    return requests({
        url: '/contactsApply/save',
        method: 'post',
        data: data
    })
}

export const reqContactsAppLyList = () => {
    return requests({
        url: '/contactsApply/list',
        method: 'get',
    })
}

export const reqApplyStatus = (data) => {
    return requests({
        url: '/contactsApply/examine',
        method: 'put',
        data: data
    })
}

export const reqContactsInfo = (data) => {
    return requests({
        url: '/contacts/info/' + data,
        method: 'get',
    })
}

export const reqQuestionSubmit = (data) => {
    return requests({
        url: '/feedback/save',
        method: 'post',
        data: data
    })
}

export const reqGetNoticeList = (data) => {
    return requests({
        url: '/notice/getList',
        method: 'get',
        params: data
    })
}

export const reqAddGroup = (data) => {
    return requests({
        url: '/group/save',
        method: 'post',
        data: data
    })
}

export const reqUpdateGroup = (data) => {
    return requests({
        url: '/group/update',
        method: 'put',
        data: data
    })
}

export const reqUpdateContacts = (data) => {
    return requests({
        url: '/contacts/update',
        method: 'put',
        data: data
    })
}

export const reqDeleteAllOpApply = () => {
    return requests({
        url: '/contactsApply/delete',
        method: 'put',
    })
}